<%@ page import="activity.Field" %>

<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'CID', 'error')} ">
	<label for="CID">
		<g:message code="field.CID.label" default="CID" />
		
	</label>
	<g:select name="CID" from="${fieldInstance.constraints.CID.inList}" value="${fieldInstance?.CID}" valueMessagePrefix="field.CID" noSelection="['': '']"/>
        R:前台必填欄位，Y:前台非必填欄位，N:前台不出現欄位
</div>

<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'service', 'error')} ">
	<label for="service">
		<g:message code="field.service.label" default="Service" />
		
	</label>
	<g:select name="service" from="${fieldInstance.constraints.service.inList}" value="${fieldInstance?.service}" valueMessagePrefix="field.service" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'title', 'error')} ">
	<label for="title">
		<g:message code="field.title.label" default="Title" />
		
	</label>
	<g:select name="title" from="${fieldInstance.constraints.title.inList}" value="${fieldInstance?.title}" valueMessagePrefix="field.title" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'tel1', 'error')} ">
	<label for="tel1">
		<g:message code="field.tel1.label" default="Tel1" />
		
	</label>
	<g:select name="tel1" from="${fieldInstance.constraints.tel1.inList}" value="${fieldInstance?.tel1}" valueMessagePrefix="field.tel1" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'tel2', 'error')} ">
	<label for="tel2">
		<g:message code="field.tel2.label" default="Tel2" />
		
	</label>
	<g:select name="tel2" from="${fieldInstance.constraints.tel2.inList}" value="${fieldInstance?.tel2}" valueMessagePrefix="field.tel2" noSelection="['N': 'N']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'email1', 'error')} ">
	<label for="email1">
		<g:message code="field.email1.label" default="Email1" />
		
	</label>
	<g:select name="email1" from="${fieldInstance.constraints.email1.inList}" value="${fieldInstance?.email1}" valueMessagePrefix="field.email1" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'email2', 'error')} ">
	<label for="email2">
		<g:message code="field.email2.label" default="Email2" />
	</label>
	<g:select name="email2" from="${fieldInstance.constraints.email2.inList}" value="${fieldInstance?.email2}" valueMessagePrefix="field.email2" noSelection="['N': 'N']"/>
</div>

<g:if test="${fieldInstance.event?.custom1}">        
<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'custom1', 'error')} ">
    <label for="custom1">
        ${fieldInstance.event?.custom1}
    </label>
    <g:select name="custom1" from="${fieldInstance.constraints.custom1.inList}" value="${fieldInstance?.custom1}" valueMessagePrefix="field.custom1" noSelection="['': '']"/>
</div>
</g:if>

<g:if test="${fieldInstance.event?.custom2}">        
<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'custom2', 'error')} ">
    <label for="custom2">
            ${fieldInstance.event?.custom2}
    </label>
    <g:select name="custom2" from="${fieldInstance.constraints.custom2.inList}" value="${fieldInstance?.custom2}" valueMessagePrefix="field.custom1" noSelection="['': '']"/>
</div>
</g:if>

<div class="fieldcontain ${hasErrors(bean: fieldInstance, field: 'event', 'error')} required">
	<label for="event">
		<g:message code="field.event.label" default="Event" />
		<span class="required-indicator">*</span>
	</label>
	<g:select disabled="true" id="event" name="event.id" from="${activity.Event.list()}" optionKey="id" required="" value="${fieldInstance?.event?.id}" class="many-to-one"/>
        <g:hiddenField name="event.id" value="${fieldInstance?.event?.id}" />
</div>